
const mongoose = require('../db/conn')
let client = new mongoose.Schema({
    uname: String,
    phoneid: Number,
    pwd: String,
}, { versionKey: false })
let clientmodel = mongoose.model('client', client)
const LoginSchema = new mongoose.Schema({
    phone: String,
    password: String,
})
let journeySchema = new mongoose.Schema({
    start: String,
    end: String,
    times: String,
    userid: String,   
})
let progressSchema = new mongoose.Schema({
    ty:String,
    txt:String,
    jid: {
        type: mongoose.Types.ObjectId,
        ref: 'journey'
    },
    times:{
        type:Date,
        default:new Date()
    },
    sta:String,
    ptxt:String,

})
const Login = mongoose.model('Login', LoginSchema)
let journeyModel = mongoose.model('journey', journeySchema, 'journey')
let progressModel = mongoose.model('progress',progressSchema,'progress')
module.exports = {
    clientmodel,
    journeyModel,
    progressModel,
    Login
}
